New feature: Report query latencies and index size #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new feature: The query latency details will be tracked and reported; the index size will be also reported.
Changes:
modified: examples/inference/distilsplade_max/beir_scifact/all_in_one.sh
: Check out this example for the final demo report!modified: sparse_retrieval/inference/aio.py
: Add new arguments tosearch.run
andevaluate.run
;modified: sparse_retrieval/inference/search.py
:output_latency
to specify the output latency file.LatencyReporter
;LatencyReporter
to record eachsearcher.search/batch_search
and report the latency details into a file calledlatency.tsv
(under the same path ofrun.tsv
);latency.tsv
isf"{qid}\t{word_length}\t{latency}\t{batch_size}\n"
modified: sparse_retrieval/inference/evaluate.py
:latency_path
andindex_path
as the paths to the stats source;bins
to specify the binning query latencies wrt. how many word-length bins.modified: sparse_retrieval/inference/utils.py
: Some new util functions to support the new features.